import { PrismaClient } from "@prisma/client";
import { NextRequest, NextResponse } from "next/server";

export const POST = async (request: NextRequest) => {
    const formData = await request.formData();
    const username = formData.get('username');

    const prisma = new PrismaClient();

    const user = await prisma.user_items.create({
        data: {
            user_id: 1,
            name: JSON.parse(username?.toString() || ""),
        },
    });

    return NextResponse.json(JSON.stringify(user));
}